//
//  UserInfoHeaderCell.m
//  Luxury
//
//  Created by DCQ on 2018/5/18.
//  Copyright © 2018年 ZNXZ. All rights reserved.
//

#import "UserInfoHeaderCell.h"
#import "UserInfoModel.h"
@interface UserInfoHeaderCell()
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UIImageView *userImgV;
@property (weak, nonatomic) IBOutlet UILabel *remainingLabel;//余额
@property (weak, nonatomic) IBOutlet UILabel *preferentialLabel;//优惠
@property (weak, nonatomic) IBOutlet UILabel *hongbaoLabel;//红包

@end
@implementation UserInfoHeaderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (IBAction)tapUserInfoAction:(id)sender {
    if (self.touchBlock) {
        self.touchBlock(touchType_personal);
    }
}
- (IBAction)leftAction:(id)sender {
    if (self.touchBlock) {
        self.touchBlock(touchType_remaining);
    }
}
- (IBAction)centerAction:(id)sender {
    if (self.touchBlock) {
        self.touchBlock(touchType_discount);
    }
}
- (IBAction)rightAction:(id)sender {
    if (self.touchBlock) {
        self.touchBlock(touchType_redPacket);
    }
}
- (void)setupUserInfo:(UserInfoModel *)model{
    [self.userImgV yy_setImageWithURL:[NSURL URLWithString:model.avatar_url] placeholder:nil];
    self.userName.text = model.nickname;
    self.remainingLabel.text = [NSString stringWithFormat:@"%@", model.wallet_balance];
    self.preferentialLabel.text =  [NSString stringWithFormat:@"%@",model.coupon_num];
    self.hongbaoLabel.text =  [NSString stringWithFormat:@"%@",model.redpack_num];
}
@end
